|
|
#define | SDHC_HAL_DAT0_LEVEL (BM_SDHC_PRSSTAT_DLSL & (1 << 24)) |
| |
|
#define | SDHC_HAL_MAX_BLOCK_COUNT (BS_SDHC_BLKATTR_BLKCNT - 1) |
| |
|
#define | SDHC_HAL_ENABLE_DMA BM_SDHC_XFERTYP_DMAEN |
| |
|
#define | SDHC_HAL_DISABLE_DMA (0U) |
| |
|
#define | SDHC_HAL_CMD_TYPE_SUSPEND (BF_SDHC_XFERTYP_CMDTYP(1)) |
| |
|
#define | SDHC_HAL_CMD_TYPE_RESUME (BF_SDHC_XFERTYP_CMDTYP(2)) |
| |
|
#define | SDHC_HAL_CMD_TYPE_ABORT (BF_SDHC_XFERTYP_CMDTYP(3)) |
| |
|
#define | SDHC_HAL_ENABLE_BLOCK_COUNT BM_SDHC_XFERTYP_BCEN |
| |
|
#define | SDHC_HAL_DISABLE_BLOCK_COUNT (0U) |
| |
|
#define | SDHC_HAL_ENABLE_AUTO_CMD12 BM_SDHC_XFERTYP_AC12EN |
| |
|
#define | SDHC_HAL_DISABLE_AUTO_CMD12 (0U) |
| |
|
#define | SDHC_HAL_DISABLE_AUTO_CMD12 (0U) |
| |
|
#define | SDHC_HAL_ENABLE_DATA_READ BM_SDHC_XFERTYP_DTDSEL |
| |
|
#define | SDHC_HAL_MULTIPLE_BLOCK BM_SDHC_XFERTYP_MSBSEL |
| |
|
#define | SDHC_HAL_SINGLE_BLOCK (0U) |
| |
|
#define | SDHC_HAL_NO_RESPONE (0U) |
| |
|
#define | SDHC_HAL_RESP_LEN_136 ((0x1 << BP_SDHC_XFERTYP_RSPTYP) & BM_SDHC_XFERTYP_RSPTYP) |
| |
|
#define | SDHC_HAL_RESP_LEN_48 ((0x2 << BP_SDHC_XFERTYP_RSPTYP) & BM_SDHC_XFERTYP_RSPTYP) |
| |
|
#define | SDHC_HAL_RESP_LEN_48_BC ((0x3 << BP_SDHC_XFERTYP_RSPTYP) & BM_SDHC_XFERTYP_RSPTYP) |
| |
|
#define | SDHC_HAL_ENABLE_CRC_CHECK BM_SDHC_XFERTYP_CCCEN |
| |
|
#define | SDHC_HAL_DISABLE_CRC_CHECK (0U) |
| |
|
#define | SDHC_HAL_ENABLE_INDEX_CHECK BM_SDHC_XFERTYP_CICEN |
| |
|
#define | SDHC_HAL_DISABLE_INDEX_CHECK (0U) |
| |
|
#define | SDHC_HAL_DATA_PRESENT BM_SDHC_XFERTYP_DPSEL |
| |
|
#define | SDHC_HAL_NO_DATA_PRESENT (0U) |
| |
|
#define | SDHC_HAL_MAX_DVS (16U) |
| |
|
#define | SDHC_HAL_INITIAL_DVS (1U) /* initial value of divisor to calculate clock rate */ |
| |
|
#define | SDHC_HAL_INITIAL_CLKFS (2U) /* initial value of clock selector to calculate clock rate */ |
| |
|
#define | SDHC_HAL_NEXT_DVS(x) do { ((x) += 1); } while(0) |
| |
|
#define | SDHC_HAL_PREV_DVS(x) do { ((x) -= 1); } while(0) |
| |
|
#define | SDHC_HAL_MAX_CLKFS (256U) |
| |
|
#define | SDHC_HAL_NEXT_CLKFS(x) do { ((x) <<= 1); } while(0) |
| |
|
#define | SDHC_HAL_PREV_CLKFS(x) do { ((x) >>= 1); } while(0) |
| |
|
#define | SDHC_HAL_CMD_COMPLETE_INT BM_SDHC_IRQSTAT_CC |
| |
|
#define | SDHC_HAL_TRANS_COMPLETE_INT BM_SDHC_IRQSTAT_TC |
| |
|
#define | SDHC_HAL_BLOCK_GAP_EVENT_INT BM_SDHC_IRQSTAT_BGE |
| |
|
#define | SDHC_HAL_DMA_INT BM_SDHC_IRQSTAT_DMAE |
| |
|
#define | SDHC_HAL_BUF_WRITE_READY_INT BM_SDHC_IRQSTAT_BWR |
| |
|
#define | SDHC_HAL_BUF_READ_READY_INT BM_SDHC_IRQSTAT_BRR |
| |
|
#define | SDHC_HAL_CARD_INSERTION_INT BM_SDHC_IRQSTAT_CINS |
| |
|
#define | SDHC_HAL_CARD_REMOVAL_INT BM_SDHC_IRQSTAT_CRM |
| |
|
#define | SDHC_HAL_CARD_INT BM_SDHC_IRQSTAT_CINT |
| |
|
#define | SDHC_HAL_CMD_TIMEOUT_ERR_INT BM_SDHC_IRQSTAT_CTOE |
| |
|
#define | SDHC_HAL_CMD_CRC_ERR_INT BM_SDHC_IRQSTAT_CCE |
| |
|
#define | SDHC_HAL_CMD_END_BIT_ERR_INT BM_SDHC_IRQSTAT_CEBE |
| |
|
#define | SDHC_HAL_CMD_INDEX_ERR_INT BM_SDHC_IRQSTAT_CIE |
| |
|
#define | SDHC_HAL_DATA_TIMEOUT_ERR_INT BM_SDHC_IRQSTAT_DTOE |
| |
|
#define | SDHC_HAL_DATA_CRC_ERR_INT BM_SDHC_IRQSTAT_CCE |
| |
|
#define | SDHC_HAL_DATA_END_BIT_ERR_INT BM_SDHC_IRQSTAT_DEBE |
| |
|
#define | SDHC_HAL_AUTO_CMD12_ERR_INT BM_SDHC_IRQSTAT_AC12E |
| |
|
#define | SDHC_HAL_DMA_ERR_INT BM_SDHC_IRQSTAT_DMAE |
| |
|
#define | SDHC_HAL_ACMD12_NOT_EXEC_ERR BM_SDHC_AC12ERR_AC12NE |
| |
|
#define | SDHC_HAL_ACMD12_TIMEOUT_ERR BM_SDHC_AC12ERR_AC12TOE |
| |
|
#define | SDHC_HAL_ACMD12_END_BIT_ERR BM_SDHC_AC12ERR_AC12EBE |
| |
|
#define | SDHC_HAL_ACMD12_CRC_ERR BM_SDHC_AC12ERR_AC12CE |
| |
|
#define | SDHC_HAL_ACMD12_INDEX_ERR BM_SDHC_AC12ERR_AC12IE |
| |
|
#define | SDHC_HAL_ACMD12_NOT_ISSUE_ERR BM_SDHC_AC12ERR_CNIBAC12E |
| |
|
#define | SDHC_HAL_SUPPORT_ADMA BM_SDHC_HTCAPBLT_ADMAS |
| |
|
#define | SDHC_HAL_SUPPORT_HIGHSPEED BM_SDHC_HTCAPBLT_HSS |
| |
|
#define | SDHC_HAL_SUPPORT_DMA BM_SDHC_HTCAPBLT_DMAS |
| |
|
#define | SDHC_HAL_SUPPORT_SUSPEND_RESUME BM_SDHC_HTCAPBLT_SRS |
| |
|
#define | SDHC_HAL_SUPPORT_3_3_V BM_SDHC_HTCAPBLT_VS33 |
| |
|
#define | SDHC_HAL_SUPPORT_3_0_V BM_SDHC_HTCAPBLT_VS30 |
| |
|
#define | SDHC_HAL_SUPPORT_1_8_V BM_SDHC_HTCAPBLT_VS18 |
| |
|
#define | SDHC_HAL_ACMD12_NOT_EXEC_ERR_EVENT BM_SDHC_FEVT_AC12NE |
| |
|
#define | SDHC_HAL_ACMD12_TIMEOUT_ERR_EVENT BM_SDHC_FEVT_AC12TOE |
| |
|
#define | SDHC_HAL_ACMD12_CRC_ERR_EVENT BM_SDHC_FEVT_AC12CE |
| |
|
#define | SDHC_HAL_ACMD12_END_BIT_ERR_EVENT BM_SDHC_FEVT_AC12EBE |
| |
|
#define | SDHC_HAL_ACMD12_INDEX_ERR_EVENT BM_SDHC_FEVT_AC12IE |
| |
|
#define | SDHC_HAL_ACMD12_NOT_ISSUE_ERR_EVENT BM_SDHC_FEVT_CNIBAC12E |
| |
|
#define | SDHC_HAL_CMD_TIMEOUT_ERR_EVENT BM_SDHC_FEVT_CTOE |
| |
|
#define | SDHC_HAL_CMD_CRC_ERR_EVENT BM_SDHC_FEVT_CCE |
| |
|
#define | SDHC_HAL_CMD_END_BIT_ERR_EVENT BM_SDHC_FEVT_CEBE |
| |
|
#define | SDHC_HAL_CMD_INDEX_ERR_EVENT BM_SDHC_FEVT_CIE |
| |
|
#define | SDHC_HAL_DATA_TIMEOUT_ERR_EVENT BM_SDHC_FEVT_DTOE |
| |
|
#define | SDHC_HAL_DATA_CRC_ERR_EVENT BM_SDHC_FEVT_DCE |
| |
|
#define | SDHC_HAL_DATA_END_BIT_ERR_EVENT BM_SDHC_FEVT_DEBE |
| |
|
#define | SDHC_HAL_ACMD12_ERR_EVENT BM_SDHC_FEVT_AC12E |
| |
|
#define | SDHC_HAL_CARD_INT_EVENT BM_SDHC_FEVT_CINT |
| |
|
#define | SDHC_HAL_DMA_ERROR_EVENT BM_SDHC_FEVT_DMAE |
| |
|
#define | SDHC_HAL_RST_TYPE_ALL BM_SDHC_SYSCTL_RSTA |
| |
|
#define | SDHC_HAL_RST_TYPE_CMD BM_SDHC_SYSCTL_RSTC |
| |
|
#define | SDHC_HAL_RST_TYPE_DATA BM_SDHC_SYSCTL_RSTD |
| |
|
#define | SDHC_HAL_MAX_BLKLEN_512B (0U) |
| |
|
#define | SDHC_HAL_MAX_BLKLEN_1024B (1U) |
| |
|
#define | SDHC_HAL_MAX_BLKLEN_2048B (2U) |
| |
|
#define | SDHC_HAL_MAX_BLKLEN_4096B (3U) |
| |
|
| static bool | sdhc_hal_is_valid_instance (uint8_t instance) |
| | Checks whether the given instance is valid. More...
|
| |
| static void | sdhc_hal_set_dma_addr (uint8_t instance, uint32_t address) |
| | Configures the DMA address. More...
|
| |
| static uint32_t | sdhc_hal_get_dma_addr (uint8_t instance) |
| | Gets the DMA address. More...
|
| |
| static uint32_t | sdhc_hal_get_blksz (uint8_t instance) |
| | Gets the block size configured. More...
|
| |
| static void | sdhc_hal_set_blksz (uint8_t instance, uint32_t blockSize) |
| | Sets the block size. More...
|
| |
| static void | sdhc_hal_set_blkcnt (uint8_t instance, uint32_t blockCount) |
| | Sets the block count. More...
|
| |
| static uint32_t | sdhc_hal_get_blkcnt (uint8_t instance) |
| | Gets the block count configured. More...
|
| |
| static void | sdhc_hal_set_cmd_arg (uint8_t instance, uint32_t arg) |
| | Configures the command argument. More...
|
| |
| static void | sdhc_hal_send_cmd (uint8_t instance, uint32_t index, uint32_t flags) |
| | Sends a command. More...
|
| |
| static void | sdhc_hal_set_data (uint8_t instance, uint32_t data) |
| | Fills the the data port. More...
|
| |
| static uint32_t | sdhc_hal_get_data (uint8_t instance) |
| | Retrieves the data from the data port. More...
|
| |
| static uint32_t | sdhc_hal_is_cmd_inhibit (uint8_t instance) |
| | Checks whether the command inhibit bit is set or not. More...
|
| |
| static uint32_t | sdhc_hal_is_data_inhibit (uint8_t instance) |
| | Checks whether data inhibit bit is set or not. More...
|
| |
| static uint32_t | sdhc_hal_is_data_line_active (uint8_t instance) |
| | Checks whether data line is active. More...
|
| |
| static uint32_t | sdhc_hal_is_sd_clk_stable (uint8_t instance) |
| | Checks whether the SD clock is stable or not. More...
|
| |
| static uint32_t | sdhc_hal_is_ipg_clk_off (uint8_t instance) |
| | Checks whether the IPG clock is off or not. More...
|
| |
| static uint32_t | sdhc_hal_is_sys_clk_off (uint8_t instance) |
| | Checks whether the system clock is off or not. More...
|
| |
| static uint32_t | sdhc_hal_is_per_clk_off (uint8_t instance) |
| | Checks whether the peripheral clock is off or not. More...
|
| |
| static uint32_t | sdhc_hal_is_sd_clk_off (uint8_t instance) |
| | Checks whether the SD clock is off or not. More...
|
| |
| static uint32_t | sdhc_hal_is_write_trans_active (uint8_t instance) |
| | Checks whether the write transfer is active or not. More...
|
| |
| static uint32_t | sdhc_hal_is_read_trans_active (uint8_t instance) |
| | Checks whether the read transfer is active or not. More...
|
| |
| static uint32_t | sdhc_hal_is_buf_write_enabled (uint8_t instance) |
| | Check whether the buffer write is enabled or not. More...
|
| |
| static uint32_t | sdhc_hal_is_buf_read_enabled (uint8_t instance) |
| | Checks whether the buffer read is enabled or not. More...
|
| |
| static uint32_t | sdhc_hal_is_card_inserted (uint8_t instance) |
| | Checks whether the card is inserted or not. More...
|
| |
| static uint32_t | sdhc_hal_is_cmd_line_level_high (uint8_t instance) |
| | Checks whether the command line signal is high or not. More...
|
| |
| static uint32_t | sdhc_hal_get_data_line_level (uint8_t instance) |
| | Gets the data line signal level or not. More...
|
| |
| static void | sdhc_hal_set_led_state (uint8_t instance, sdhc_hal_led_t state) |
| | Sets the LED state. More...
|
| |
| static void | sdhc_hal_set_data_trans_width (uint8_t instance, sdhc_hal_dtw_t dtw) |
| | Sets the data transfer width. More...
|
| |
| static bool | sdhc_hal_is_d3cd_enabled (uint8_t instance) |
| | Checks whether the DAT3 is taken as card detect pin. More...
|
| |
| static void | sdhc_hal_enable_d3cd (uint8_t instance, bool isEnabled) |
| | Enables the DAT3 as a card detect pin. More...
|
| |
| static void | sdhc_hal_set_endian (uint8_t instance, sdhc_hal_endian_t endianMode) |
| | Configures the endian mode. More...
|
| |
| static uint32_t | sdhc_hal_get_cd_test_level (uint8_t instance) |
| | Gets the card detect test level. More...
|
| |
| static void | sdhc_hal_enable_cd_test (uint8_t instance, bool isEnabled) |
| | Enables the card detect test. More...
|
| |
| static void | sdhc_hal_set_dma_mode (uint8_t instance, sdhc_hal_dma_mode_t dmaMode) |
| | Sets the DMA mode. More...
|
| |
| static void | sdhc_hal_enable_stop_at_blkgap (uint8_t instance, bool isEnabled) |
| | Enables stop at the block gap. More...
|
| |
| static void | sdhc_hal_continue_req (uint8_t instance) |
| | Restarts a transaction which has stopped at the block gap. More...
|
| |
| static void | sdhc_hal_enable_read_wait_ctrl (uint8_t instance, bool isEnabled) |
| | Enables teh read wait control for the SDIO cards. More...
|
| |
| static void | sdhc_hal_enable_intr_stop_at_blk_gap (uint8_t instance, bool isEnabled) |
| | Enables stop at the block gap requests. More...
|
| |
| static void | sdhc_hal_enable_wakeup_on_card_intr (uint8_t instance, bool isEnabled) |
| | Enables wakeup event on the card interrupt. More...
|
| |
| static void | sdhc_hal_enable_wakeup_on_card_ins (uint8_t instance, bool isEnabled) |
| | Enables wakeup event on the card insertion. More...
|
| |
| static void | sdhc_hal_enable_wakeup_on_card_rm (uint8_t instance, bool isEnabled) |
| | Enables wakeup event on card removal. More...
|
| |
| static void | sdhc_hal_enable_ipg_clk (uint8_t instance, bool isEnabled) |
| | Enables the IPG clock, then no automatic clock gating off. More...
|
| |
| static void | sdhc_hal_enable_sys_clk (uint8_t instance, bool isEnabled) |
| | Enables the system clock, then no automatic clock gating off. More...
|
| |
| static void | sdhc_hal_enable_per_clk (uint8_t instance, bool isEnabled) |
| | Enables the peripheral clock, then no automatic clock gating off. More...
|
| |
| static void | sdhc_hal_enable_sd_clk (uint8_t instance, bool isEnabled) |
| | Enables the SD clock. More...
|
| |
| static void | sdhc_hal_set_clk_div (uint8_t instance, uint32_t divisor) |
| | Sets the SD clock frequency divisor. More...
|
| |
| static void | sdhc_hal_set_clk_freq (uint8_t instance, uint32_t freq) |
| | Sets the SD clock frequency select. More...
|
| |
| static void | sdhc_hal_set_data_timeout (uint8_t instance, uint32_t timeout) |
| | Sets the data timeout counter value. More...
|
| |
| static void | sdhc_hal_reset (uint8_t instance, uint32_t type) |
| | Performs the kinds of SDHC reset. More...
|
| |
| static uint32_t | sdhc_hal_is_reset_done (uint8_t instance, uint32_t type) |
| | Checks whether the given SDHC reset is finished. More...
|
| |
| static void | sdhc_hal_init_card (uint8_t instance) |
| | Sends 80 SD clock cycles to the card. More...
|
| |
| static uint32_t | sdhc_hal_is_init_card_done (uint8_t instance) |
| | Checks whether sending 80 SD clock cycles to card is finished. More...
|
| |
| static uint32_t | sdhc_hal_get_intr_flags (uint8_t instance) |
| | Gets the current interrupt status. More...
|
| |
| static void | sdhc_hal_clear_intr_flags (uint8_t instance, uint32_t mask) |
| | Clears a specified interrupt status. More...
|
| |
| static uint32_t | sdhc_hal_get_intr_signal (uint8_t instance) |
| | Gets the currently enabled interrupt signal. More...
|
| |
| static uint32_t | sdhc_hal_get_intr_state (uint8_t instance) |
| | Gets the currently enabled interrupt state. More...
|
| |
| static uint32_t | sdhc_hal_get_ac12_error (uint8_t instance) |
| | Gets the auto cmd12 error. More...
|
| |
| static uint32_t | sdhc_hal_get_max_blklen (uint8_t instance) |
| | Gets the maximum block length supported. More...
|
| |
| static uint32_t | sdhc_hal_host_can_do_adma (uint8_t instance) |
| | Checks whether the ADMA is supported. More...
|
| |
| static uint32_t | sdhc_hal_host_can_do_highspeed (uint8_t instance) |
| | Checks whether the high speed is supported. More...
|
| |
| static uint32_t | sdhc_hal_host_can_do_dma (uint8_t instance) |
| | Checks whether the DMA is supported. More...
|
| |
| static uint32_t | sdhc_hal_host_can_do_suspend_resume (uint8_t instance) |
| | Checks whether the suspend/resume is supported. More...
|
| |
| static uint32_t | sdhc_hal_host_supports_v330 (uint8_t instance) |
| | Checks whether the voltage 3.3 is supported. More...
|
| |
| static uint32_t | sdhc_hal_host_supports_v300 (uint8_t instance) |
| | Checks whether the voltage 3.0 is supported. More...
|
| |
| static uint32_t | sdhc_hal_host_supports_v180 (uint8_t instance) |
| | Checks whether the voltage 1.8 is supported. More...
|
| |
| static void | sdhc_hal_set_write_watermark (uint8_t instance, uint32_t watermark) |
| | Sets the watermark for writing. More...
|
| |
| static void | sdhc_hal_set_read_watermark (uint8_t instance, uint32_t watermark) |
| | Sets the watermark for reading. More...
|
| |
| static void | sdhc_hal_set_force_event_flags (uint8_t instance, uint32_t mask) |
| | Sets the force events according to the given mask. More...
|
| |
| static uint32_t | sdhc_hal_is_adma_len_mismatch_err (uint8_t instance) |
| | Checks whether the ADMA error is length mismatch. More...
|
| |
| static uint32_t | sdhc_hal_get_adma_error_stat (uint8_t instance) |
| | Gets back the state of the ADMA error. More...
|
| |
| static uint32_t | sdhc_hal_is_adma_desc_err (uint8_t instance) |
| | Checks whether the ADMA error is a descriptor error. More...
|
| |
| static void | sdhc_hal_set_adma_addr (uint8_t instance, uint32_t address) |
| | Sets the ADMA address. More...
|
| |
| static void | sdhc_hal_enable_ext_dma_req (uint8_t instance, bool isEnabled) |
| | Enables the external DMA request. More...
|
| |
| static void | sdhc_hal_enable_exact_blk_num (uint8_t instance, bool isEnabled) |
| | Enables the exact block number for the SDIO CMD53. More...
|
| |
| static void | sdhc_hal_set_boot_ack_timeout (uint8_t instance, uint32_t timeout) |
| | Sets the timeout value for the boot ACK. More...
|
| |
| static void | sdhc_hal_enable_boot_ack (uint8_t instance, bool isEnabled) |
| | Enables the boot ACK. More...
|
| |
| static void | sdhc_hal_set_boot_mode (uint8_t instance, sdhc_hal_mmcboot_t mode) |
| | Configures the boot mode. More...
|
| |
| static void | sdhc_hal_enable_fastboot (uint8_t instance, bool isEnabled) |
| | Enables the fast boot. More...
|
| |
| static void | sdhc_hal_enable_auto_stop_at_blkgap (uint8_t instance, bool isEnabled) |
| | Enables the automatic stop at the block gap. More...
|
| |
| static void | sdhc_hal_set_boot_blkcnt (uint8_t instance, uint32_t blockCount) |
| | Configures the the block count for the boot. More...
|
| |
| static uint32_t | sdhc_hal_get_spec_ver (uint8_t instance) |
| | Gets a specification version. More...
|
| |
| static uint32_t | sdhc_hal_get_vendor_ver (uint8_t instance) |
| | Gets the vendor version. More...
|
| |
| void | sdhc_hal_get_resp (uint8_t instance, uint32_t *resp) |
| | Gets the command response. More...
|
| |
| void | sdhc_hal_enable_intr_signal (uint8_t instance, bool isEnabled, uint32_t mask) |
| | Enables the specified interrupts. More...
|
| |
| void | sdhc_hal_enable_intr_state (uint8_t instance, bool isEnabled, uint32_t mask) |
| | Enables the specified interrupt state. More...
|
| |